/*  ___ _  ____  __ _  _    ___       _ _          
 * | _ \ |/ /  \/  | \| |  / _ \ _ _ | (_)_ _  ___ 
 * |  _/ ' <| |\/| | .` | | (_) | ' \| | | ' \/ -_)
 * |_| |_|\_\_|  |_|_|\_|  \___/|_||_|_|_|_||_\___|
 */
#ifndef __PKMNONLINE_MAPSCENE_H__
#define __PKMNONLINE_MAPSCENE_H__
#include "../scene.h"
#include "../texturemanager.h"
#include "../animation.h"
#include "../map.h"
#include "../actor.h"
#include <map>

typedef std::map<u_int, CActor *> CActorMap;

class CMapScene: public CScene {
public:
	CMapScene();

	void	Render();
	void	LoadTileset(const char *szTextureFile, const char *szDefinitionFile);
	CMap   *GetMap() const { return m_pMap; }
	void	SetMap(CMap *pMap) { m_pMap = pMap; }
	CActor *GetTarget() const { return m_pTargetActor; }
	void	SetTarget(CActor *pTarget) { m_pTargetActor = pTarget; }
	void	AddActor(u_int nId, CActor *pActor);
	void	RemoveActor(u_int nId);
	CActor *GetActorById(u_int nId);
	int     GetSceneType() const { return SCENE_MAP; }

private:
	CMap	   *m_pMap;
	CTexture   *m_pTileset;
	CActor     *m_pTargetActor;

	int			m_nMaxTileWidth;
	int			m_nMaxTileHeight;
	int			m_nTilesetWidth;
	int			m_nTilesetHeight;
	float		m_flTileWidth;
	float		m_flTileHeight;
	CActorMap	m_mapActors;
};

#endif /* __PKMNONLINE_MAPSCENE_H__ */
